#include "HiddenSoldierPhysics.h"

 void HiddenSoldierPhysics::updateBeforeDead() {
	_armyData->getRect()->X += 1;
	_armyData->getRect()->Y += 3;
	_armyData->delayForDead--;
	if (_armyData->delayForDead <= 0) {
		_armyData->isDead = true;
	}
}

 void HiddenSoldierPhysics::_setToDead(int actiondata) {
	_armyData->canInteract = false;
	_armyData->isDead = true;
	_armyData->delayForDead = 5;
}
/* Constructor to set ref, with not null ref */
 HiddenSoldierPhysics::HiddenSoldierPhysics(ArmyData* data) : RedGunPhysics(data) {
	deltaYBullet = 20;
	_life = 1;
	_armyData->bulletContainer->setMaxBullet(1);
}

 void  HiddenSoldierPhysics::update(long timetick) {
	if(_armyData->delayForDead > 0) {
		updateBeforeDead();
	} else {
		RedGunPhysics::update(timetick);
	}
}